<#include "../inc/view.html"/>
<@view>
<div class="row">
    <div class="col-sm-12">
        <ul class="nav nav-tabs tabs">
            <li class="active tab">
                <a href="#profile${nowtime}" data-toggle="tab" aria-expanded="false">
                    <span class="visible-xs"><i class="fa fa-user"></i></span>
                    <span class="hidden-xs">个人资料</span>
                </a>
            </li>
            <li class="tab">
                <a href="#avvatorF${nowtime}" data-toggle="tab" aria-expanded="true">
                    <span class="visible-xs"><i class="fa fa-envelope-o"></i></span>
                    <span class="hidden-xs">头像</span>
                </a>
            </li>
            <li class="tab">
                <a href="#modifyPwd${nowtime}" data-toggle="tab" aria-expanded="true">
                    <span class="visible-xs"><i class="fa fa-envelope-o"></i></span>
                    <span class="hidden-xs">修改密码</span>
                </a>
            </li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane active" id="profile${nowtime}">
                <form id="profileForm" name="profileForm" class="form-horizontal" action="/admin/sysUser/saveProfile"
                      method="post" data-validator-option="{theme:'yellow_top'}">

                </form>
            </div>
            <div class="tab-pane active" id="avvatorF${nowtime}">
                <form id="profileForm" name="profileForm" class="form-horizontal" action="/admin/sysUser/saveProfile"
                      method="post" data-validator-option="{theme:'yellow_top'}">
                </form>
            </div>
            <div class="tab-pane" id="modifyPwd${nowtime}">
                <form id="modifyPwdForm${nowtime}" name="modifyPwdForm" class="form-horizontal"
                      action="/admin/sysUser/modifyPwd"
                      method="post" data-validator-option="{theme:'yellow_top'}">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-md-2 control-label">旧密码</label>
                                <div class="col-md-4">
                                    <input type="password" class="form-control" name="oldpwd" data-rule="旧密码:required" minlength="6">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-md-2 control-label">新密码</label>
                                <div class="col-md-4">
                                    <input type="password" class="form-control" name="newpwd" data-rule="新密码:required" minlength="6">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-md-2 control-label">重复密码</label>
                                <div class="col-md-4">
                                    <input type="password" class="form-control" name="repwd" data-rule="重复密码:required" minlength="6">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="col-md-2 control-label"></label>
                                <div class="col-md-4">
                                    <button type="submit" class="btn btn-sm btn-success"><i class="ti-save"></i> 修改密码</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</@view>
<script>
    $(function () {
        ajaxForm($("#profileForm"), function (json) {
            if (json.code == RESULT_SUCCESS) {
                layer.msg("修改个人信息成功!",{time:3000});
            } else {
                if (json.msg)
                    layer.alert(json.msg, {icon: 5, title: '系统提示', shadeClose: true,time:3000});
            }
        });
        ajaxForm($("#modifyPwdForm${nowtime}"), function (json) {
            if (json.code == RESULT_SUCCESS) {
                layer.msg("修改密码成功!请牢记密码.",{time:3000});
            } else {
                if (json.msg)
                    layer.alert(json.msg, {icon: 5, title: '系统提示', shadeClose: true,time:3000});
            }
        });
    });
</script>